package com.ctshk.rpc.ship.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ctshk.common.utils.EntityUtil;
import com.ctshk.rpc.ship.dto.MainDataShipPortListDTO;
import com.ctshk.rpc.ship.dto.ShipConstants;
import com.ctshk.rpc.ship.entity.MainDataShipPort;
import com.ctshk.rpc.ship.mapper.MainDataShipPortMapper;
import com.ctshk.rpc.ship.service.IMainDataShipPortService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 船票港口主数据 服务实现类
 * </p>
 *
 * @author 刘蕾
 * @since 2021-04-13
 */
@DubboService
public class MainDataShipPortServiceImpl extends ServiceImpl<MainDataShipPortMapper, MainDataShipPort> implements IMainDataShipPortService {

    @Autowired
    private MainDataShipPortMapper mainDataShipPortMapper;

    @Override
    public List<MainDataShipPortListDTO> queryMainDataList() {
        List<MainDataShipPort> mainDataShipPorts = mainDataShipPortMapper.selectList(new QueryWrapper<MainDataShipPort>().lambda()
                .eq(MainDataShipPort::getIsDeleted, ShipConstants.NOT_DELETE));
        return EntityUtil.copyList(mainDataShipPorts, MainDataShipPortListDTO.class);
    }
}
